package com.xinqi.modules.sys.textbook.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 云课本状态：1-正常；2-禁用
 *
 * @author linkai
 * @date 2023/5/3
 */
public enum TextbookStatusEnum implements BaseEnum {
    /**
     * 正常
     */
    ENABLE("1", "正常"),
    /**
     * 禁用
     */
    DISABLE("2", "禁用"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    TextbookStatusEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static TextbookStatusEnum of(String code) {
        return BaseEnum.of(TextbookStatusEnum.class, code);
    }

}
